<!DOCTYPE html>
<html lang="zh-CN">
<head>
    <meta charset="utf-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1">
    <title>登录界面</title>
    <link href="https://cdn.jsdelivr.net/npm/bootstrap@3.3.7/dist/css/bootstrap.min.css" rel="stylesheet">
    <style>
        .bg {
            background:url(/static/img/1.png) no-repeat center;
            background-size:contain;
        }
    </style>
</head>
<body>
<div id="app" class="container">
    <div class="row ">
        <div class="col-md-4"></div>
        <!-- <form action="/demo/sign/signin" method="post"> -->

            <div class="col-md-4">
                <h1>学生信息管理系统</h1>
                <p class="h1 text-center">登录</p>
                <div>
                    <input type="text" name="username" class="form-control" v-model="username" placeholder="用户名">
                </div>
                <br>
                <div>
                    <input type="password" name="password" class="form-control" v-model="password" placeholder="密码">
                </div>
                <br>
                <button type="submit" class="btn btn-info btn-block" @click="signin()">登录</button>
            </div>
        <!-- </form> -->
        <div class="col-md-4">
        </div>
    </div>
</div>

<script src="https://cdn.jsdelivr.net/npm/jquery@1.12.4/dist/jquery.min.js"></script>
<script src="https://cdn.jsdelivr.net/npm/bootstrap@3.3.7/dist/js/bootstrap.min.js"></script>
<script src="https://cdn.staticfile.org/vue/2.2.2/vue.min.js"></script>
<script>
    var app = new Vue({
        el:'#app',
        data:{
            Msg:'',
            username:'',
            password:'',
            // stuInfoList:[]
        },
        methods:{
            signin:function(){
                $.ajax({
                    url:'/demo/SysM/valid',
                    type:'GET',
                    data:{'username':app.username,'password':app.password},
                    // dataType:'json',
                    success:function (result) {
                        // app.stuInfoList = result;
                        // result = JSON.parse(result);
                        if(result === "成功"){
                            window.location.href="/demo/SysM/admin";
                        }else{
                            alert(result);
                        }
                    }
                });
            }
        }
    })
</script>
</body>
</html>